


*******************************************************************************
*******************************************************************************
*******************************************************************************
***																			***
***			This dofile contains the code to reproduce Figures 1-7, 		***
***         Figures SI1a and 1b, as well as all tables in the paper 		***
***			"Trading votes: What drives MEP support for                     ***
***			trade liberalisation?" by Robert Basedow and Julian Hoerner     ***
***			which appears in the Journal of European Public Policy.         ***
***			Please note that the code to produce figures 8-12, SI2, 		***
***			and SI3-SI17 can be found in a seperate R script 				***
***			and .txt files.													***
***																			***
***			Please consult the readme file for further information 			***
***			          														***
***																			***
***																			***
***																			***
***																			***
*******************************************************************************
*******************************************************************************
*******************************************************************************


*******************************************************************************
*Set the Version: This analysis was carried out on Stata Version 18.0 for Windows
*******************************************************************************

version 18.0

********************************************************************************
*Install User-Written Commands
********************************************************************************
findit esttab // esttab -- Display formatted regression table (Ben Jann, ETH Zurich, jann@soz.gess.ethz.ch)
findit combomarginsplot // Nick Winter, 2014. "COMBOMARGINSPLOT: Stata module to combine the saved results from multiple calls to margins into one marginsplot," Statistical Software Components S457804, Boston College Department of Economics, revised 12 Nov 2021.
findit grc1leg //  Program by Vince Wiggins, StataCorp <vwiggins@stata.com>.Statalist distribution, 16 June 2003.
findit plotplain //   Bischof, D. 2017. New graphic schemes for Stata: plotplain and plottig. Stata Journal 17: 748-759.


********************************************************************************
*Set Folder: Set the folder which contains the data and to which the figures and tables will be saved
********************************************************************************
capture cd "C:\Users\julia\Dropbox\EP Trade Paper\Drafts\3rd submission (final)\Replication 24.07.2023" // please edit this to align with your pathname 

log using EP_Trade.log, replace


***********************************************************************
*Load the dataset for the analyis 
********************************************************************************
use "C:\Users\julia\Dropbox\EP Trade Paper\Drafts\3rd submission (final)\Final Replication Files\EP_Trade_Dataset_Final_24072023.dta" // please edit this to align with your pathname 

********************************************************************************
*Statement in Footnote 3
********************************************************************************

cor std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate


********************************************************************************
*Descritpive Figures  

********************************************************************************


*Figure 1:  Number of votes per term

collapse term dum_lib, by(resolution_id)
by resolution_id, sort: gen nvals = _n == 1
bysort term dum_lib: egen sum_nvals= sum(nvals)

label values dum_lib dum_lib_label 

graph bar sum_nvals, over (dum_lib) over(term) ytitle("Number of Votes") scheme(plotplain)

graph save "Figure1.gph", replace // please edit this to align with your pathname 

*Figure 2: Number of votes per term by procedure 

collapse dum_lib procedure_new term, by(resolution_id)
by resolution_id, sort: gen nvals = _n == 1
bysort term procedure_new dum_lib: egen sum_nvals= sum(nvals)

label values procedure_new procedure_new_label
label values dum_lib dum_lib_label 
set scheme plotplain
graph bar sum_nvals, over (dum_lib) over (procedure_new, lab(angle(45))) over(term) ytitle("Number of Votes")  scheme(plotplain)

graph save "Figure2.gph", replace // please edit this to align with your pathname 

*Figure 3: Number of votes over time

collapse month, by(dum_lib resolution_id)

gen lib_yes=1 if dum_lib==1
gen lib_no=1 if dum_lib==0

collapse (sum) lib_no lib_yes, by(month)

tsset month
tsfill

label var lib_yes "liberal"
label var lib_no "not liberal"

set scheme plotplain
line  lib_yes lib_no month,  xlabel(594 "Term 7" 654 "Term 8" 714 "Term 9") xtick(594  654  714) xtitle("time") ytitle("Number of Votes per Month") scheme(plotplain)  

graph save "Figure3.gph", replace // please edit this to align with your pathname 

*Figure 4: Voting frquency per issue area 

collapse dum_lib issue_area term, by(resolution_id)
by resolution_id, sort: gen nvals = _n == 1
bysort term issue_area dum_lib: egen sum_nvals= sum(nvals)

label values issue_area_new issue_area
label values dum_lib dum_lib_label 

set scheme plotplain 
graph bar sum_nvals, over (dum_lib) over (issue_area, lab(angle(45)) ) over (term) ytitle("Number of Votes") scheme(plotplain) 

graph save "Figure4.gph", replace // please edit this to align with your pathname 

*Figure 5: Support in liberal votes by MEPs per group


keep if dum_lib==1
replace eurogroup=4 if eurogroup==3
replace eurogroup=9 if eurogroup==5
collapse for, by( eurogroup ) 
set scheme plotplain
graph bar for, over (eurogroup) ytitle("Share of Votes in Favour") scheme(plotplain) 

graph save "Figure5.gph", replace // please edit this to align with your pathname 

 
*Figure 6: Support for liberal votes by MEPs per country 

keep if dum_lib==1
collapse for, by( member_state ) 

set scheme plotplain
graph bar for, over (member_state, lab(angle(45))) ytitle("Share of Votes in Favour") scheme(plotplain) 

graph save "Figure6.gph", replace // please edit this to align with your pathname 


********************************************************************************
*Main Models - Table 1 
********************************************************************************

* Model 1 - All
logit for std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate std_sq_salience_norm_10  i.year if dum_lib==1, vce(cluster MEP_ID)
est store Model1

* Model 2 - Trade Agreements 
logit for std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate std_sq_salience_norm_10   i.year if dum_lib==1 & procedure_new==2, vce(cluster MEP_ID)
est store Model2

* Model 3 - Regulations, Directives, Resolutions 
logit for std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate  std_sq_salience_norm_10 i.year if dum_lib==1 & procedure_new!=2, vce(cluster MEP_ID)
est store Model3

*Creating Table 1
esttab Model1 Model2 Model3 using EP_Trade_Main_Model_Table1.rtf, replace se label drop(*year) title (Vote in Favour) nonumbers mtitles ("Model 1 - All" "Model 2 - Trade Agreements" "Model 3 - Regulations, Directives, Resolutions" ) b(%9.3f) se(%9.2f) star(* 0.1 ** 0.05 *** 0.01) nogap

*The numbers of RCVs were entered into the table manually 

********************************************************************************
*Predicted probabilities- Figure 7 
********************************************************************************

set scheme plotplain

* Model 1 - All
logit for std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate std_sq_salience_norm_10  i.year if dum_lib==1, vce(cluster MEP_ID)

margins, at(std_eu_emtk_ab_t =(-.74 7.25)) atmeans saving (agri_model1, replace)
margins, at(std_eu_unemp_1574t =(-1.41  4.88)) atmeans  saving (unemp_model1, replace)
margins, at (std_rile_nat_ipolate =(-2.92 2.32)) atmeans  saving (rile_model1, replace)
margins, at (std_pro_anti_EU_nat_ipolate =(-6.44 3.99)) atmeans  saving(EU_model1, replace)
margins, at (std_protectionism_nat_ipolate =(-2.86 4.99)) atmeans saving (prot_model1, replace)
margins, at (std_sq_salience_norm_10 =(-.80 8.95)) atmeans  saving(polit_model1, replace)

* Model 2 - Trade Agreements
logit for std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate std_sq_salience_norm_10   i.year if dum_lib==1 & procedure_new==2, vce(cluster MEP_ID)

margins, at( std_eu_emtk_ab_t =(-.74 7.25)) atmeans  saving (agri_model2, replace) 
*statement in the main text: unemployment 
margins, at( std_eu_unemp_1574t =(-1.41  4.88)) atmeans  
margins, at( std_eu_unemp_1574t =(-1.41  4.88)) atmeans saving (unemp_model2, replace) 
margins, at( std_rile_nat_ipolate =(-2.92 2.32)) atmeans  saving (rile_model2, replace)
*statement in the main text: EU attitude (example)
margins, at( std_pro_anti_EU_nat_ipolate =(-6.44 3.99)) atmeans  
margins, at( std_pro_anti_EU_nat_ipolate =(-6.44 3.99)) atmeans  saving(EU_model2, replace)
*statement in the main text: protectionism
margins, at( std_protectionism_nat_ipolate =(-2.86 4.99))
margins, at( std_protectionism_nat_ipolate =(-2.86 4.99)) atmeans  saving (prot_model2, replace)
margins, at( std_sq_salience_norm_10 =(-.80 8.95)) atmeans  saving(polit_model2, replace)

* Model 3 - Regulations, Directives, Resolutions
logit for std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate std_sq_salience_norm_10  i.year if dum_lib==1 & procedure_new!=2, vce(cluster MEP_ID)


margins, at( std_eu_emtk_ab_t =(-.74 7.25)) atmeans  saving (agri_model3, replace)
margins, at( std_eu_unemp_1574t =(-1.41  4.88)) atmeans  saving (unemp_model3, replace)
margins, at( std_rile_nat_ipolate =(-2.92 2.32)) atmeans  saving (rile_model3, replace)
margins, at( std_pro_anti_EU_nat_ipolate =(-6.44 3.99)) atmeans saving (EU_model3, replace)
margins, at( std_protectionism_nat_ipolate =(-2.86 4.99))  atmeans saving (prot_model3, replace)
*statement in the main text: politicization 
margins, at( std_sq_salience_norm_10 =(-.80 8.95)) atmeans
margins, at( std_sq_salience_norm_10 =(-.80 8.95)) atmeans  saving (polit_model3, replace)

* Comine Marginsplots
combomarginsplot agri_model1 agri_model2 agri_model3, labels("Model 1 - All" "Model 2 - Trade Agreements" "Model 3 - Regulations, Directives, Resolutions")  title("")  recastci(rarea) ciopt(color(%20)) legend(col(1)) saving(Agriculture, replace)
combomarginsplot unemp_model1 unemp_model2 unemp_model3, labels("Model 1 - All" "Model 2 - Trade Agreements" "Model 3 - Regulations, Directives, Resolutions")  title("") ytitle("")  recastci(rarea) ciopt(color(%20)) legend(col(1)) saving (Unemployment, replace)
combomarginsplot rile_model1 rile_model2 rile_model3, labels("Model 1 - All" "Model 2 - Trade Agreements" "Model 3 - Regulations, Directives, Resolutions")  title("")  ytitle("")recastci(rarea) ciopt(color(%20)) legend(col(1))  saving (Rile, replace) 
combomarginsplot EU_model1 EU_model2 EU_model3, labels("Model 1 - All" "Model 2 - Trade Agreements" "Model 3 - Regulations, Directives, Resolutions")  title("")  recastci(rarea) ciopt(color(%20)) legend(col(1))  saving (EU, replace)
combomarginsplot prot_model1 prot_model2 prot_model3, labels("Model 1 - All" "Model 2 - Trade Agreements" "Model 3 - Regulations, Directives, Resolutions")  title("") ytitle("") recastci(rarea) ciopt(color(%20)) legend(col(1))  saving (Protectionism, replace)
combomarginsplot polit_model1 polit_model2 polit_model3, labels("Model 1 - All" "Model 2 - Trade Agreements" "Model 3 - Regulations, Directives, Resolutions" )  title("") ytitle("") recastci(rarea) ciopt(color(%20)) legend(col(1))  saving (Politicisation, replace)


*Combining, creating, and saving the figure

grc1leg Agriculture.gph Unemployment.gph Rile.gph EU.gph Protectionism.gph Politicisation.gph

graph save "Figure7.gph", replace // please edit this to align with your pathname 





  
********************************************************************************
*Interaction Effect Models - Table 2 
********************************************************************************

*Model 4 - All
logit for  std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_rile_nat_ipolate c.std_sq_salience_norm_10##c.std_pro_anti_EU_nat_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year if dum_lib==1, vce(cluster MEP_ID)
est store Model4

*Model 5 - Trade Agreements
logit for std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_rile_nat_ipolate c.std_sq_salience_norm_10##c.std_pro_anti_EU_nat_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year if dum_lib==1 & procedure_new==2, vce(cluster MEP_ID)
est store Model5

*Model 6 - Regulations, Directives, Resolutions 
logit for  std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_rile_nat_ipolate c.std_sq_salience_norm_10##c.std_pro_anti_EU_nat_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year if dum_lib==1 & procedure_new!=2, vce(cluster MEP_ID)
est store Model6

*Creating Table 1
esttab Model4 Model5 Model6 using EP_Trade_Main_Model_Interactions_Table2.rtf, replace se label drop(*year) title (Vote in Favour) nonumbers mtitles("Model 1 - All" "Model 2 - Trade Agreements" "Model 3 - Regulations, Directives, Resolutions" )  b(%9.3f) se(%9.2f) star(* 0.1 ** 0.05 *** 0.01) nogap

*The numbers of RCVs were entered into the table manually 

********************************************************************************
*Marginal Effects - Figures 8-10 
********************************************************************************

*To estimate (conditional) marginal effects for our interaction models, we follow the procedure by Hainmueller et al., 2019.
*We estimate these models in R. Therefore, we export the dataset first as an excel file 


export delimited using "C:\Users\julia\Dropbox\EP Trade Paper\Drafts\3rd submission (final)\Final Replication Files\EP_Trade_Dataset_Final_24072023.csv", nolabel replace // please edit this to align with your pathname 

* We then estimate the models using the inteflex package in R 

*--> continue replication in R using "your directory\EP_Trade_Dataset_Final_24072023.csv", and the R replication ("EP_Trade_Interflex_Script_R.R") script to create Figures 8-12 and the individual panels of Figure SI2

* Figure SI2 was compiled using LaTeX (use "EP_Trade_Figures_SI2.txt")

*(details can be found in the readme file)



**References: 

*Hainmueller, J., Mummolo, J., Xu, Y., 2019. How Much Should We Trust Estimates from Multiplicative Interaction Models? Simple Tools to Improve Empirical Practice. Political Analysis 27, 163–192. https://doi.org/10.1017/pan.2018.46

*R Package: https://cran.r-project.org/web/packages/interflex/interflex.pdf


********************************************************************************
***DESCRIPTIVE STATISTICS
********************************************************************************
*Table SI1

estpost sum  for std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_unemp_1574t std_eu_gdp_pps_hab_eu27_2020  std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate  std_sq_salience_norm_10 std_lrgen_ipolate std_eu_position_ipolate
esttab using EP_Trade_Descritptives_Table_SI1.rtf, replace label cells("count(fmt(0)) mean(fmt(2)) sd(fmt(2)) min(fmt(2)) max(fmt(2))")  p(2) nogaps 


*Figure SI1a : Politicization variable by member state over time (root transformed)

collapse sq_salience_norm_10 salience_norm_10, by (member_state monthly_date)
xtset member_state monthly_date

set scheme plotplain

label var salience_norm_10 "Politicization"
label var  sq_salience_norm_10 "Politicization (Square Root)"

xtline salience_norm_10 

graph save "FigureSI1a.gph", replace // please edit this to align with your pathname 

*Figure SI1b : Politicization variable by member state over time (not transformed)

xtline sq_salience_norm_10
graph save "FigureSI1b.gph", replace // please edit this to align with your pathname 

********************************************************************************
********************************************************************************
****Robustness Checks
********************************************************************************
********************************************************************************


********************************************************************************
****Abstention Counted as votes for and against - Table SI 2 
********************************************************************************



**Abstentions for 

*Main Models


* Model 7 - All
logit abs_for std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate std_sq_salience_norm_10  i.year if dum_lib==1, vce(cluster MEP_ID)
est store Model7


* Model 8 - Trade Agreements
logit abs_for std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate std_sq_salience_norm_10  i.year if dum_lib==1 & procedure_new==2, vce(cluster MEP_ID)
est store Model8


* Model 9 - Regulations, Directives, Resolutions 
logit abs_for std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate std_sq_salience_norm_10  i.year if dum_lib==1 & procedure_new!=2, vce(cluster MEP_ID)
est store Model9


***Abstentions against

*Main Models 

* Model 10 -All
logit abs_against std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate std_sq_salience_norm_10  i.year if dum_lib==1, vce(cluster MEP_ID)
est store Model10



* Model 11 - Trade Agreements
logit abs_against std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate std_sq_salience_norm_10  i.year if dum_lib==1 & procedure_new==2, vce(cluster MEP_ID)
est store Model11


* Model 12 - Regulations, Directives, Resolutions 
logit abs_against std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate std_sq_salience_norm_10  i.year if dum_lib==1 & procedure_new!=2, vce(cluster MEP_ID)
est store Model12


*Create Regression Table
esttab Model7 Model8 Model9 Model10 Model11 Model12 using EP_Trade_Robustness_Abstentions_TableSI2.rtf, replace se label drop(*year) title (Votenonumbers mtitles("Model 7 - All" "Model 8 - Trade Agreements" "Model 9 - Regulations, Directives, Resolutions" ))  b(%9.3f) se(%9.2f) star(* 0.1 ** 0.05 *** 0.01) nogap

*The numbers of RCVs were entered into the table manually 

********************************************************************************
****Abstention Counted as votes for and against (Interaction effects) - Table SI 3 
********************************************************************************

*Model 13 - All
logit  abs_for std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_rile_nat_ipolate c.std_sq_salience_norm_10##c.std_pro_anti_EU_nat_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year if dum_lib==1, vce(cluster MEP_ID)
est store Model13

*Model 14 - Trade Agreements
logit abs_for std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_rile_nat_ipolate c.std_sq_salience_norm_10##c.std_pro_anti_EU_nat_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year if dum_lib==1& procedure_new==2 , vce(cluster MEP_ID)
est store Model14

*Model 15 - Regulations, Decision, Resolutions 
logit  abs_for std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_rile_nat_ipolate c.std_sq_salience_norm_10##c.std_pro_anti_EU_nat_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year if dum_lib==1 & procedure_new!=2, vce(cluster MEP_ID)
est store Model15

*Model 16 - All 
logit abs_against std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_rile_nat_ipolate c.std_sq_salience_norm_10##c.std_pro_anti_EU_nat_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year if dum_lib==1, vce(cluster MEP_ID)
est store Model16

*Model 17 - Trade Agreements 
logit  abs_against std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_rile_nat_ipolate c.std_sq_salience_norm_10##c.std_pro_anti_EU_nat_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year if dum_lib==1& procedure_new==2 , vce(cluster MEP_ID)
est store Model17

*Model 18 - Regulations, Decision, Resolutions 
logit abs_against std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_rile_nat_ipolate c.std_sq_salience_norm_10##c.std_pro_anti_EU_nat_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year if dum_lib==1 & procedure_new!=2, vce(cluster MEP_ID)
est store Model18

*Create Regression Table
esttab Model13 Model14 Model15 Model16 Model17 Model18 using EP_Trade_Robustness_Abstentions_Interaction_TableSI3.rtf, replace se label drop(*year) title (Vote in Favour) nonumbers mtitles("Model 13 - All" "Model 14 - Trade Agreements" "Model 15 - Regulations, Directives, Resolutions" "Model 16 - All" "Model 17 - Trade Agreements" "Model 18 - Regulations, Directives, Resolutions"  )  b(%9.3f) se(%9.2f) star(* 0.1 ** 0.05 *** 0.01) nogap

*The numbers of RCVs were entered into the table manually 

*******************************************************************************
****Multinomial Logistic Regression - Table SI 4 
********************************************************************************

*Main Models


* Model 19 - all
mlogit vote_mult std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate std_sq_salience_norm_10  i.year if dum_lib==1, vce(cluster MEP_ID)
est store Model19


* Model 20 - Trrade Agreements 
mlogit vote_mult std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate std_sq_salience_norm_10   i.year if dum_lib==1 & procedure_new==2, vce(cluster MEP_ID)
est store Model20


* Model 21 - Regulations, Decision, Resolutions  
mlogit vote_mult std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_rile_nat_ipolate std_pro_anti_EU_nat_ipolate std_protectionism_nat_ipolate std_sq_salience_norm_10  i.year if dum_lib==1 & procedure_new!=2, vce(cluster MEP_ID)
est store Model21

*Create Regression Table
esttab Model19 Model20 Model21 using EP_Trade_Robustness_Multinom_TableSI4.rtf, replace se label drop(*year) title (Vote in Favour) nonumbers mtitles ("Model 19 - All" "Model 20- Trade Agreements" "Model 21 - Regulations, Directives, Resolutions" ) b(%9.3f) se(%9.2f) star(* 0.1 ** 0.05 *** 0.01) nogap

*The numbers of RCVs were entered into the table manually 


********************************************************************************
****Multinomial Logistic Regressions (Interaction effects) - Table SI 5
********************************************************************************


*Model 22 - All 
mlogit vote_mult  std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_rile_nat_ipolate c.std_sq_salience_norm_10##c.std_pro_anti_EU_nat_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year if dum_lib==1, vce(cluster MEP_ID)
est store Model22

*Model 23 - Trade Agreements 
mlogit vote_mult std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_rile_nat_ipolate c.std_sq_salience_norm_10##c.std_pro_anti_EU_nat_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year if dum_lib==1 & procedure_new==2 , vce(cluster MEP_ID)
est store Model23

*Model 24 - Regulations, Decision, Resolutions
mlogit vote_mult  std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_rile_nat_ipolate c.std_sq_salience_norm_10##c.std_pro_anti_EU_nat_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year   if dum_lib==1 & procedure_new!=2 , vce(cluster MEP_ID)
est store Model24

*Create Regression Table
esttab Model22 Model23 Model24 using EP_Trade_Robustness_Multinom_Interaction_TableSI5.rtf, replace se label drop(*year) title (Vote in Favour) nonumbers mtitles("Model 22 - All" "Model 23 - Trade Agreements" "Model 24- Regulations, Directives, Resolutions")   b(%9.3f) se(%9.2f) star(* 0.1 ** 0.05 *** 0.01) nogap

*The numbers of RCVs were entered into the table manually 


********************************************************************************
****CHES data for EU attitude and Left/Right position - Table SI6 
*******************************************************************************

* Model 25 - All
logit for std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_sq_salience_norm_10 std_lrgen_ipolate std_eu_position_ipolate std_protectionism_nat_ipolate  i.year if dum_lib==1, vce(cluster MEP_ID)
est store Model25

* Model 26 - Trade Agreements
logit for std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_sq_salience_norm_10 std_lrgen_ipolate std_eu_position_ipolate std_protectionism_nat_ipolate i.year if dum_lib==1 & procedure_new==2, vce(cluster MEP_ID)
est store Model26

* Model 27 - Regulations, Decision, Resolutions
logit for std_eu_emtk_ab_t std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 std_eu_unemp_1574t std_sq_salience_norm_10 std_lrgen_ipolate std_eu_position_ipolate std_protectionism_nat_ipolate i.year if dum_lib==1 & procedure_new!=2, vce(cluster MEP_ID)
est store Model27


*Create Regression Table
esttab Model25 Model26 Model27 using EP_Trade_Robustness_CHES_TableSI6.rtf, replace se label drop(*year) title (Vote in Favour) nonumbers mtitles ("Model 25 - All" "Model 26 - Trade Agreements" "Model 27- Regulations, Directives, Resolutions" ) b(%9.3f) se(%9.2f) star(* 0.1 ** 0.05 *** 0.01) nogap

*The numbers of RCVs were entered into the table manually 


********************************************************************************
****CHES data for EU attitude and Left/Right position (Interactions) - Table SI7 
******************************************************************************

*Model 28 - All
logit for std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_lrgen_ipolate c.std_sq_salience_norm_10##c.std_eu_position_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year if dum_lib==1, vce(cluster MEP_ID)
est store Model28

*Model 29 - Trade Agreements 
logit for std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_lrgen_ipolate c.std_sq_salience_norm_10##c.std_eu_position_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year if dum_lib==1  & procedure_new==2, vce(cluster MEP_ID)
est store Model29

*Model 30 - Regulations, Decision, Resolutions
logit for std_eu_emtk_htc_t std_eu_gdp_pps_hab_eu27_2020 c.std_sq_salience_norm_10##c.std_eu_emtk_ab_t c.std_sq_salience_norm_10##c.std_eu_unemp_1574t c.std_sq_salience_norm_10##c.std_lrgen_ipolate c.std_sq_salience_norm_10##c.std_eu_position_ipolate c.std_sq_salience_norm_10##c.std_protectionism_nat_ipolate i.year if dum_lib==1 & procedure_new!=2, vce(cluster MEP_ID)
est store Model30

*Create Regression Table
esttab Model28 Model29 Model30 using EP_Trade_Robustness_CHES_Interaction_TableSI7.rtf, replace se label drop(*year) title (Vote in Favour) nonumbers mtitles("Model 28 - All" "Model 29 - Trade Agreements" "Model 30- Regulations, Directives, Resolutions" )  b(%9.3f) se(%9.2f) star(* 0.1 ** 0.05 *** 0.01) nogap

*The numbers of RCVs were entered into the table manually 

********************************************************************************
*Marginal Effects - Figures SI3-SI17
********************************************************************************

*To estimate the (conditional) marginal effects, we again use the interflex procecure in R

* We estimate the models using the inteflex package in R (Xu et al., 2017). 

*--> continue replication in R using "your directory\EP_Trade_Dataset_Final_24072023.csv", and the R replication script ("EP_Trade_Interflex_Script_R.R") to create the individual panels of Figures SI3-SI17

* Figures SI3-SI17 were compiled using LaTeX (use "EP_Trade_Figures_SI3_SI17.txt")

*(details can be found in the readme file)




